<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("path", basePath);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>三级页面</title>
</head>
<body>
	<p>当前类别：${goodsType.typeName}</p>
	<table border="1px" cellspacing="0px">
		<tr>
			<th>选择</th>
			<th>类别Id</th>
			<th>属性名称(attrName)</th>
			<th>中文名称</th>
			<th>字典类型</th>
			<th>输入类型</th>
			<th>校验规则</th>
		</tr>

		<c:forEach items="${requestScope.attributeMetedataList}"
			var="attributeMetadata">

			<tr>
				<td>${attributeMetadata.id}</td>
				<td>${attributeMetadata.goodsTypeId}</td>
				<td>${attributeMetadata.attribute}</td>
				<th>${attributeMetadata.attText}</th>
				<td>${attributeMetadata.dictType}</td>
				<td>${attributeMetadata.type}</td>
				<th>${attributeMetadata.validateRules}</th>
			</tr>
			<input type="hidden" value="删除"
				onclick="deleteUser(${attributeMetadata.id})">
			<input type="hidden" value="修改"
				onclick="updateUser(${attributeMetadata.id})">
		</c:forEach>


	</table>

	<p>新增属性</p>
	<form action="<%=path%>/goodsType/addAttributeMatedata.do"
		method="post" id="addAttr">
		<input name="goodsTypeId" id="goodsTypeId" type="hidden"
			value="${goodsType.id}" />
		<table border="1px" cellspacing="0px">
			<tr>
				<td>attrName</td>
				<td><input name="attribute" id="attribute" type="text" /></td>
				<td>中文名称</td>
				<td><input name="attText" id="attText" type="text" /></td>
			</tr>
			<tr>
				<td style="color: red">字典类型</td>
				<td><select name="dictType">
				            <option value="">无</option>
						<c:forEach items="${requestScope.dictLists}" var="str">
							<option value="${str}">${str}</option>
						</c:forEach>
				</select></td>
				<td>输入类型</td>
				<td><select name="type">
						<option value="text">文本框</option>
						<option value="radio">单选框</option>
						<option value="checkbox">复选框</option>
						<option value="select">下拉菜单</option>
						<option value="password">密码框</option>
				</select></td>
			</tr>
			<tr>
				<td>校验规则</td>
				<td colspan="3"><input name="validateRules" id="validateRules"
					type="text" /></td>
			</tr>

			<tr>
				<td><input type="reset" value="重置" /></td>
				<td><input type="submit" value="提交" /></td>
			</tr>

		</table>
	</form>
</body>
</html>